package com.zstu.mall.service.impl;

import org.springframework.stereotype.Service;
import org.springframework.beans.factory.annotation.Autowired;
import com.zstu.mall.common.BaseServiceImpl;
import com.zstu.mall.service.UserService;
import com.zstu.mall.entity.User;
import com.zstu.mall.dao.UserDao;

import java.util.List;

/**
 * @author     : wuyc
 * @description: UserServiceImpl
 * @date       : Created in 2019/11/24
 */
@Service
public class UserServiceImpl extends BaseServiceImpl<User, String, UserDao> implements UserService {

	@Autowired
	private UserDao userDao;

	/**
	 * 根据用户名查询
	 *
	 * @param name
	 * @return
	 */
	@Override
	public List<User> findByName(String name) {
		return userDao.findByName(name);
	}

	/**
	 * 检查登录
	 *
	 * @param username
	 * @param password
	 * @return
	 */
	@Override
	public User checkLogin(String username, String password) {
		return userDao.findByNameAndPassword(username, password);
	}

	/**
	* 校验支付密码
    * @param username
    * @param payPassword
    * @return
	*/
	public User checkPay(String username,String payPassword){return userDao.findByNameAndPaypassword(username, payPassword);}

}
